// pages/classify/classify.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        asideBars: ["卡片、证件", "生活用品", "电子产品", "美妆护肤类", "衣物", "饰品", "文娱", "其他"],
        rightList: [
            [{
                    "url": "../../images/idcard.png",
                    text: "身份证"
                },
                {
                    "url": "../../images/campuscard.png",
                    text: "校园卡"
                },
                {
                    "url": "../../images/stucard.png",
                    text: "学生证"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "水卡"
                },
                {
                    "url": "../../images/buscard.png",
                    text: "公交卡"
                },
                {
                    "url": "../../images/bankcard.png",
                    text: "银行卡"
                },
                {
                    "url": "../../images/other.png",
                    text: "其他"
                },
            ],
            [{
                    "url": "../../images/demo2.jpg",
                    text: "水杯"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "雨伞"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "小风扇"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "钥匙/钥匙扣"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "其他"
                }
            ],
            [{
                    "url": "../../images/demo2.jpg",
                    text: "手机"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "相机"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "U盘/磁盘"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "充电宝"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "平板电脑"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "鼠标"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "数据线"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "耳机"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "电子笔"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "支架"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "音响"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "MP3"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "其他"
                }
            ],
            [{
                    "url": "../../images/demo2.jpg",
                    text: "口红"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "粉底"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "眉笔"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "腮红"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "眼影"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "防晒"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "喷雾"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "香水"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "其他"
                }
            ],
            [{
                    "url": "../../images/demo2.jpg",
                    text: "男装"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "女装"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "男鞋"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "女鞋"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "包包"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "其他"
                }
            ],
            [{
                    "url": "../../images/demo2.jpg",
                    text: "手表"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "项链"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "手链"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "戒指"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "耳饰"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "眼镜"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "帽子"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "发饰"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "其他"
                }
            ],
            [{
                    "url": "../../images/demo2.jpg",
                    text: "教材"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "笔记"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "文具"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "球/球拍"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "护具"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "跳绳"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "自行车"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "棋牌"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "其他"
                }
            ],
            [{
                    "url": "../../images/demo2.jpg",
                    text: "药品"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "零食"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "周边"
                },
                {
                    "url": "../../images/demo2.jpg",
                    text: "其他"
                }
            ]
        ],
        select: 0
    },

    toClassifyList(e) {
        // console.log(e)
        const {
            text
        } = e.currentTarget.dataset;
        wx.navigateTo({
            url: `../classifyList/classifyList?text=${text}&from=classify`,
        })
    },

    // 侧边栏的选择
    selectBar(e) {
        const {
            index
        } = e.currentTarget.dataset
        this.setData({
            select: index
        })
    },

    // 跳转到搜索页面
    toSearch() {
        wx.navigateTo({
            url: '../search/search',
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        if (typeof this.getTabBar === 'function' && this.getTabBar()) {
            this.getTabBar().setData({
                select: 1
            })
        }
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})